package com.training.java.core.tdd;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import junit.framework.TestCase;

public class CalculatorTest {
	
	Calculator cal =new Calculator();
	
	@Before
	public void init()
	{
		cal=new Calculator();	
	}
	
	@Test
	public void Adding2and3shouldgiveme5()
	{
		//Calculator cal=new Calculator();
		int result=(int) cal.add(2,3);
		TestCase.assertEquals(5, result);
	}
	
	@Test
	public void Adding5and8shoulgiveme13()
	{
		//Calculator cal=new Calculator();
		int result=(int) cal.add(5,8);
		TestCase.assertEquals(13, result);
	}
	
	@Test
	public void TestaddforDecimalNumber()
	{
		//Calculator cal=new Calculator();
		double result=cal.add(3.2,5.2);
		TestCase.assertEquals(8.4,result);
	}
	
	@After
	public void teardown()
	{
		cal=null;
	}
	
}

